integrate @knu's suggestions

Andrew Cantino 9 years ago
parent
commit
8713dce4d8
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app/controllers/agents_controller.rb

+ 3 - 1
app/controllers/agents_controller.rb

@@ -239,6 +239,8 @@ class AgentsController < ApplicationController
239 239
     when "show"
240 240
       if @agent && !@agent.destroyed?
241 241
         path = agent_path(@agent)
242
+      else
243
+        path = agents_path
242 244
       end
243 245
     when /\A#{Regexp::escape scenarios_path}\/\d+\z/, agents_path
244 246
       path = ret
@@ -247,7 +249,7 @@ class AgentsController < ApplicationController
247 249
     if path
248 250
       redirect_to path, notice: message
249 251
     else
250
-      redirect_to agents_path, notice: message
252
+      super agents_path, notice: message
251 253
     end
252 254
   end
253 255